/*
 * @Description: 施工进度总计划调整接口
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2021-12-24 11:44:54
 * @LastEditTime: 2022-01-12 15:06:13
 * @FilePath: \cscec-pms-admin\src\api\construction\constructionScheduleAdjust.js
 */
import request from '@/utils/request2'
import { projectApiUrl } from '@/api/config'
const api = {
  list: {
    queryList: projectApiUrl + '/schedule-plan-adjust/query-list',
    queryStatistics: projectApiUrl + '/schedule-plan-adjust/query-statistics',
    deleteBasis: projectApiUrl + '/schedule-plan-adjust/delete-basis'

  },
  view: {
    queryBasicSelectProject: projectApiUrl + '/schedule-plan-adjust/query-basic-select-project',
    planLabel: projectApiUrl + '/plan-label',
    createBasis: projectApiUrl + '/schedule-plan-adjust/create-basis',
    basisDetail: projectApiUrl + '/schedule-plan-adjust/basis-detail',
    editDetail: projectApiUrl + '/schedule-plan-adjust/edit-basis',
    planAdjustDetail: projectApiUrl + '/schedule-plan-adjust/plan-adjust-detail',
    createChildWork: projectApiUrl + '/schedule-plan-adjust/create-child-work',
    siblingWork: projectApiUrl + '/schedule-plan-adjust/sibling-work',
    queryFrontTaskTree: projectApiUrl + '/adjust-front-task/query-front-task-tree',
    queryFrontTask: projectApiUrl + '/adjust-front-task/query-front-task',
    createFrontTask: projectApiUrl + '/adjust-front-task/create-front-task',
    editFrontTask: projectApiUrl + '/adjust-front-task/edit-front-task',
    deleteFrontTask: projectApiUrl + '/adjust-front-task/delete-front-task',
    editWorkPack: projectApiUrl + '/schedule-plan-adjust/edit-work-pack',
    editWork: projectApiUrl + '/schedule-plan-adjust/edit-work',
    queryHistoryAdjustDtail: projectApiUrl + '/schedule-plan-adjust/query-history-adjust-detail',
    createSiblingWorkPack: projectApiUrl + '/schedule-plan-adjust/create-sibling-work-pack',
    createChildWorkPack: projectApiUrl + '/schedule-plan-adjust/create-child-work-pack',
    moveUp: projectApiUrl + '/schedule-plan-adjust/move-up',
    moveDown: projectApiUrl + '/schedule-plan-adjust/move-down',
    upgradeWorkPack: projectApiUrl + '/schedule-plan-adjust/upgrade-work-pack',
    downgradeWorkPack: projectApiUrl + '/schedule-plan-adjust/downgrade-work-pack',
    removeWork: projectApiUrl + '/schedule-plan-adjust/remove-work',
    removeWorkPack: projectApiUrl + '/schedule-plan-adjust/remove-work-pack',
    addFiles: projectApiUrl + '/schedule-plan-adjust/add-files',
    deleteFiles: projectApiUrl + '/schedule-plan-adjust/delete-files',
    commitAudit: projectApiUrl + '/schedule-plan-adjust/commit-audit',
  }
}
// 列表接口
const list = {
  /**
   * @description: 获取施工进度总计划调整列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryList: data => {
    return request({
      url: api.list.queryList,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取施工进度总计划调整列表统计
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryStatistics: data => {
    return request({
      url: api.list.queryStatistics,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除基本信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  deleteBasis: data => {
    return request({
      url: api.list.deleteBasis,
      method: 'post',
      data
    })
  }
}
const view = {
  /**
   * @description: 获取项目列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryBasicSelectProject: data => {
    return request({
      url: api.view.queryBasicSelectProject,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取调整原因列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  planLabel: data => {
    return request({
      url: api.view.planLabel,
      method: 'get',
      params: data
    })
  },
  /**
   * @description: 新增基础信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createBasis: data => {
    return request({
      url: api.view.createBasis,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑基础信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editDetail: data => {
    return request({
      url: api.view.editDetail,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取基本信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  basisDetail: data => {
    return request({
      url: `${api.view.basisDetail}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 获取预调整列表数据
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  planAdjustDetail: data => {
    return request({
      url: `${api.view.planAdjustDetail}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 新增下级业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createChildWork: data => {
    return request({
      url: api.view.createChildWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增同级业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  siblingWork: data => {
    return request({
      url: api.view.siblingWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取前置任务节点名称树
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryFrontTaskTree: data => {
    return request({
      url: api.view.queryFrontTaskTree,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取前置任务列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryFrontTask: data => {
    return request({
      url: `${api.view.queryFrontTask}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 新增前置任务
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createFrontTask: data => {
    return request({
      url: api.view.createFrontTask,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑前置任务
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editFrontTask: data => {
    return request({
      url: api.view.editFrontTask,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除前置任务
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  deleteFrontTask: data => {
    return request({
      url: api.view.deleteFrontTask,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editWorkPack: data => {
    return request({
      url: api.view.editWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editWork: data => {
    return request({
      url: api.view.editWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取历史调整信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryHistoryAdjustDtail: data => {
    return request({
      url: `${api.view.queryHistoryAdjustDtail}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 新增同级阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createSiblingWorkPack: data => {
    return request({
      url: api.view.createSiblingWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增下级阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createChildWorkPack: data => {
    return request({
      url: api.view.createChildWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 上移
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  moveUp: data => {
    return request({
      url: api.view.moveUp,
      method: 'post',
      data
    })
  },
  /**
   * @description: 下移
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  moveDown: data => {
    return request({
      url: api.view.moveDown,
      method: 'post',
      data
    })
  },
  /**
   * @description: 升级
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  upgradeWorkPack: data => {
    return request({
      url: api.view.upgradeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 降级
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  downgradeWorkPack: data => {
    return request({
      url: api.view.downgradeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  removeWorkPack: data => {
    return request({
      url: api.view.removeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  removeWork: data => {
    return request({
      url: api.view.removeWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 修改附件
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  addFiles: data => {
    return request({
      url: api.view.addFiles,
      method: 'post',
      data
    })
  },
  /**
   * @description: 提交审核
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  commitAudit: data => {
    return request({
      url: api.view.commitAudit,
      method: 'post',
      data
    })
  },
}
export {
  list,
  view
}